package cn.hxzy.entity.userEntity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * <p>
 * 
 * </p>
 *
 * @author ao.Li
 * @since 2023-06-23
 */
@Data
  @EqualsAndHashCode(callSuper = false)
  @Accessors(chain = true)
@TableName("tm_user")
@ApiModel(value="User对象", description="")
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID=1L;


      @ApiModelProperty(value = "用户编号")
      @NotNull
      @Length(min = 4, max = 20, message = "用户名只能在4~20位之间")
      @TableId
      private String userId;

      @ApiModelProperty(value = "注册手机号")
      @NotNull
      @Pattern(regexp = "^1[35678]\\d{9}$", message = "手机号格式不正确")
      private String userPhone;

      @ApiModelProperty(value = "密码")
      @NotNull
      @Length(min = 6, max = 9, message = "密码只能在6~9位之间")
      private String userPwd;

      @ApiModelProperty(value = "验证码")
      @TableField(exist = false)
      private String code;

      @ApiModelProperty(value = "用户类型")
      @NotNull
      private Integer userType;

      @ApiModelProperty(value = "姓名")
      @NotNull
      private String userName;

      @ApiModelProperty(value = "角色ID")
      private String roleId;

      @ApiModelProperty(value = "实名认证状态")
      private Integer userCertification;

      @ApiModelProperty(value = "车主认证")
      private Integer carOwner;

      @ApiModelProperty(value = "司机认证")
      private Integer driver;

      @ApiModelProperty(value = "货主认证")
      private Integer cargoOwner;

      @ApiModelProperty(value = "账户状态")
      private Integer accountStatus;

      @ApiModelProperty(value = "创建时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
      private Date createTime;

      @ApiModelProperty(value = "修改时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
      private Date modifyTime;

      @ApiModelProperty(value = "最后登录时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
      private Date lastLoginTime;


}
